package com.artwork.service.impl;

import com.artwork.mapper.NoticeMapper;
import com.artwork.model.Notice;
import com.artwork.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author JoJo
 * @Data 2021/9/8$ 14:44$
 * @Description
 * @Param $
 * @Return $
 */
@Service
public class NoticeServiceImpl implements NoticeService {
    @Autowired
    NoticeMapper noticeMapper;


    @Override
    public List<Notice> getList() {
        return noticeMapper.getList();
    }

    @Override
    public int addNotice(Notice notice) {
        return noticeMapper.insertSelective(notice);
    }

    @Override
    public Notice getNoticeById(Integer id) {
        return noticeMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateNotice(Notice notice) {
        return noticeMapper.updateByPrimaryKeySelective(notice);
    }

    @Override
    public int deleteNotice(int id) {
        return noticeMapper.deleteNotice(id);
    }

    @Override
    public int pushNotice(int id, int status) {
        return noticeMapper.pushNotice(id, status);
    }
}
